﻿using Wpg_VoteSys.Models.Database;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;

namespace Wpg_VoteSys.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ItemController : ControllerBase
    {
        private readonly Wpg_VoteSysContext _db;

        public ItemController(Wpg_VoteSysContext db)
        {
            _db = db;
        }
        /// <summary>
        /// 后端上传资料
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public string UploadItem(int id)
        {
            //判断是否存在该类别的项目 如果存在 上传失败 否则成功
            var userId = Response.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value;

            return "";
        }
    }
}

